//import 'package:amap_base/amap_base.dart';

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_hotwork/HomePage.dart';
import 'package:flutter_hotwork/homepage/BaseTitleBar.dart';
import 'package:flutter_hotwork/homepage/BaseViewBar.dart';
import 'package:flutter_hotwork/utils/DioUtils.dart';
// import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';
import 'package:package_info/package_info.dart';

class aboutPage extends StatefulWidget {
  @override
  messagecenterState createState() => new messagecenterState();
}

class messagecenterState extends State<aboutPage> {
  String  version="";
  @override
  void initState() {
    super.initState();
    DioUtils.createInstance();
    getVersion();
  }

  @override
  void dispose() {
//    _amapLocation.stopLocate();
    super.dispose();
  }

  TabController _tabController;

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar:new BaseViewBar(
          childView:
          Column(
            children: [
              new BaseTitleBar(
                "关于我们",
                leftIcon: 'images/fanhui.png',
                rightIcon:  "",
                rightClick: () {
                  print("点击了右边干嘛啊。。。哦");
                },
                leftClick: () {
                  Navigator.of(context).pop();
                },
              )
              ,
            ],
          ),
          preferredSize: Size.fromHeight(58.0)

      ),
      body:
      Center(
        child:
        Container(
          child:
          Text("当前版本-v"+"$version"),
        )
        ,
      ),
    );
  }
   getVersion()  {

        PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
          //APP名称
          String appName = packageInfo.appName;
          //包名
          String packageName = packageInfo.packageName;
          //版本名
          version = packageInfo.version;

          //版本号
          String buildNumber = packageInfo.buildNumber;
          setState(() { });
    });

  }


}






















